exports.title = '修改指定mac设备的状态为指定编码值';
exports.path = '/wzkc/terminal/changeState';
exports.pool = 'task';

exports.sqltext = `
update tf_r_terminal_arch a
set a.TERMINAL_STATE = :TERMINAL_STATE
where a.terminal_id=:mac
`;


// 请求范例，用于调用者了解请求数据结构，也用于系统自动内测发起请求
exports.request = {
  mac: '30F31D843655',
  TERMINAL_STATE: 'T', // 退回可用
};

exports.outConverter0 = (sqlresult) => {
  const data = sqlresult.rows[0];
  if (sqlresult.rowsAffected === 1) {
    return data;
  }
  throw new Error();
};
